function copy_text(text) {
    // Step 1: Check if the DOM element with id 'clipboard-container' exists
    let clipboardContainer = document.getElementById('clipboard-container');
    console.log("clipboardContainer",clipboardContainer)
    if (!clipboardContainer) {
        // If not, create a hidden div and append it to the body
        const newDiv = document.createElement('textarea');
        newDiv.id = 'clipboard-container';
        newDiv.style.position = 'absolute';
        newDiv.style.left = '-9999px';
        document.body.appendChild(newDiv);
        clipboardContainer = document.getElementById('clipboard-container');
    }
    clipboardContainer.value = text;
    
    clipboardContainer.focus();
    clipboardContainer.select();
   document.execCommand('copy');

}